<%- model_class = Category -%>
<div class="page-header">
  <h1><%=t '.title', :default => model_class.model_name.human.pluralize.titleize %></h1>
</div>
<table class="table table-striped">
  <thead>
    <tr>
      <th><%= model_class.human_attribute_name(:id) %></th>
      <th><%= model_class.human_attribute_name(:enmae) %></th>
      <th><%= model_class.human_attribute_name(:cataname) %></th>
      <th><%= model_class.human_attribute_name(:father) %></th>
      <th><%= model_class.human_attribute_name(:order) %></th>
      <th><%= model_class.human_attribute_name(:created_at) %></th>
      <th><%=t '.actions', :default => t("helpers.actions") %></th>
    </tr>
  </thead>
  <tbody>
    <% @categories.each do |category| %>
      <tr>
        <td><%= link_to category.id, category_path(category) %></td>
        <td><%= category.enmae %></td>
        <td><%= category.cataname %></td>
        <td><%= category.father %></td>
        <td><%= category.order %></td>
        <td><%=l category.created_at %></td>
        <td>
          <%= link_to t('.edit', :default => t("helpers.links.edit")),
                      edit_category_path(category), :class => 'btn btn-default btn-xs' %>
          <%= link_to t('.destroy', :default => t("helpers.links.destroy")),
                      category_path(category),
                      :method => :delete,
                      :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
                      :class => 'btn btn-xs btn-danger' %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= link_to t('.new', :default => t("helpers.links.new")),
            new_category_path,
            :class => 'btn btn-primary' %>
